package com.census.entity;

import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import java.sql.Date;

/**
 * Created by WangKai's Hands.
 * User:WangKai
 * Date:2017/6/30
 * Time:2:35
 * Email: 1786025737@qq.com
 */
@Entity
public class Cardinfo {
    private int idcardId;
    private String cardId;
    private String name;
    private String nation;
    private Date birthday;
    private String addressId;
    private String photo;
    private String politicesStuts;
    private String sex;

    @Id
    @Column(name = "idcard_id")
    public int getIdcardId() {
        return idcardId;
    }

    public void setIdcardId(int idcardId) {
        this.idcardId = idcardId;
    }

    @Basic
    @Column(name = "card_id")
    public String getCardId() {
        return cardId;
    }

    public void setCardId(String cardId) {
        this.cardId = cardId;
    }

    @Basic
    @Column(name = "name")
    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    @Basic
    @Column(name = "nation")
    public String getNation() {
        return nation;
    }

    public void setNation(String nation) {
        this.nation = nation;
    }

    @Basic
    @Column(name = "birthday")
    public Date getBirthday() {
        return birthday;
    }

    public void setBirthday(Date birthday) {
        this.birthday = birthday;
    }

    @Basic
    @Column(name = "address_id")
    public String getAddressId() {
        return addressId;
    }

    public void setAddressId(String addressId) {
        this.addressId = addressId;
    }

    @Basic
    @Column(name = "photo")
    public String getPhoto() {
        return photo;
    }

    public void setPhoto(String photo) {
        this.photo = photo;
    }

    @Basic
    @Column(name = "politices_stuts")
    public String getPoliticesStuts() {
        return politicesStuts;
    }

    public void setPoliticesStuts(String politicesStuts) {
        this.politicesStuts = politicesStuts;
    }

    @Basic
    @Column(name = "sex")
    public String getSex() {
        return sex;
    }

    public void setSex(String sex) {
        this.sex = sex;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        Cardinfo cardinfo = (Cardinfo) o;

        if (idcardId != cardinfo.idcardId) return false;
        if (cardId != null ? !cardId.equals(cardinfo.cardId) : cardinfo.cardId != null) return false;
        if (name != null ? !name.equals(cardinfo.name) : cardinfo.name != null) return false;
        if (nation != null ? !nation.equals(cardinfo.nation) : cardinfo.nation != null) return false;
        if (birthday != null ? !birthday.equals(cardinfo.birthday) : cardinfo.birthday != null) return false;
        if (addressId != null ? !addressId.equals(cardinfo.addressId) : cardinfo.addressId != null) return false;
        if (photo != null ? !photo.equals(cardinfo.photo) : cardinfo.photo != null) return false;
        if (politicesStuts != null ? !politicesStuts.equals(cardinfo.politicesStuts) : cardinfo.politicesStuts != null)
            return false;
        if (sex != null ? !sex.equals(cardinfo.sex) : cardinfo.sex != null) return false;

        return true;
    }

    @Override
    public int hashCode() {
        int result = idcardId;
        result = 31 * result + (cardId != null ? cardId.hashCode() : 0);
        result = 31 * result + (name != null ? name.hashCode() : 0);
        result = 31 * result + (nation != null ? nation.hashCode() : 0);
        result = 31 * result + (birthday != null ? birthday.hashCode() : 0);
        result = 31 * result + (addressId != null ? addressId.hashCode() : 0);
        result = 31 * result + (photo != null ? photo.hashCode() : 0);
        result = 31 * result + (politicesStuts != null ? politicesStuts.hashCode() : 0);
        result = 31 * result + (sex != null ? sex.hashCode() : 0);
        return result;
    }
}
